<template>
  <div class="redirect">
    <Row justify="center" align="middle">
      <img style="width: 60px" :src="require('@/assets/simnple_tool_icon.png')">
      <span style="margin-left: 10px; font-size: 26px; font-weight: bolder">Simple Tools</span>
    </Row>
    <card class="redirect-card" :padding="6" style="width: 660px; padding: 20px; margin-top: 10px" dis-hover>
      <div class="title">
        <m-icon name="[font]warn" size="40" type="warning"></m-icon>
        您将跳转到其他网站：
        <span class="target-url">{{ target }}</span>
      </div>
      <div class="desc">目标网站来源于网络收集，请注意安全，保护个人隐私</div>
      <div style="text-align: right; margin-top: 20px">
        <Button type="warning" @click="goOn">继续</Button>
      </div>
    </card>
  </div>
</template>

<script>
import MIcon from "@/components/MIcon";

export default {
  name: "Redirect",
  components: {MIcon},
  data() {
    return {
      target: ''
    }
  },
  methods: {
    goOn() {
      window.location.href = this.target;
    }
  },
  created() {
    if (this.$route.query && this.$route.query.target) {
      this.target = this.$route.query.target;
    }
  }
}
</script>

<style lang="scss" scoped>
.redirect {
  padding-top: 220px;

  .redirect-card {
    margin: 0 auto;
    word-wrap: break-word;
    font-size: 18px;
  }

  .target-url {
    color: #1aa5ff;
    font-size: 20px;
  }

  .title {
    font-size: 24px;
  }

  .desc {
    margin-top: 10px;
  }
}
</style>
